Repository navigation
feat(batch): batch watch — live read-only view of a running shift - #576
Merged
Merged
Conversation
Adds `pyauto-brain batch watch --record <brief> [--once] [--interval N]`: time left, each task's state, pick reason, PR and CI health, budgets and the last ticks, redrawn in place. It writes nothing; its reads are the watcher's own. Task wording is shared with the digest via _digest.task_state, so the two never disagree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
pyauto-brain batch watch, a live terminal view of a running shift. Until now the shift watcher said nothing until the digest atreview-at:. This view shows time left, each task's state with its pick reason, PR and CI health, the budgets, and the last ticks, redrawn in place. It is a follow-up from the orchestrator pilot (#574), wanted before the first live shift.Closes #575
API Changes
Adds the
watchverb topyauto-brain batch, with--onceand--interval(minimum 30 s); it reuses--recordand--home. Adds_digest.task_state;_linenow calls it and the digest's output is unchanged. Adds a new module,_watch.py.Details
_digest.task_state(task, counters, health, *, live=False, lease=None, agents=None)returns(state, tier_follows). Withlive=Trueit adds the states only a held lease shows:running (agent …),blocked on a person since …,running? (… not listed — inside the grace …), andcrashed — awaiting re-dispatch._watch.snapshot/render/watch/CachedHealth.max-workers:and sessions againstmax-sessions:separately (they are different caps; defaults come from_brief.cap_of).Read-only and network surface
--once, and that looking at an unstarted shift never creates its slot.claude agents --jsonper refresh, only on a live shift with real worker leases;gh pr checksonly for unmerged PRs, cached per interval. Both are reads the watcher already makes.Witness
The
--onceview of the real shadow slot2026-11-05-am, mid-shift:The live fixture (
tests/test_batch_watch.py):Tests
tests/test_batch_watch.py: 8 new tests covering live, shadow, no-tick and closed/STOP snapshots, byte-identical read-only, CLI--once, digest/watch wording parity, and the interval floor plus cached health.Tier: glance — merge mode: auto-merge on green with Witness PASS, post-merge summary.
🤖 Generated with Claude Code